package com.eastfair.projectcore.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.annotation.model.LoadService;
import com.eastfair.auth.entity.OrganizationRole;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.boot.service.SuperService;
import com.eastfair.core.base.R;
import com.eastfair.projectcore.dto.DictionaryPageQuery;
import com.eastfair.projectcore.entity.Dictionary;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 字典项
 * </p>
 *
 * @author ligang
 * @date 2021-11-01
 */
public interface DictionaryService extends SuperCacheService<Dictionary>, LoadService {

    /**
     * 根据类型查询字典
     * @param type
     * @return
     */
    List<Dictionary> queryDict(String type);

    /**
     * 查询类型分组
     * @return
     */
    List<Dictionary> queryDictGroupType();

    /**
     * 初始化菜单数据到缓存
     */
    void initDictData();


    /**
     * 删除类型
     * @return
     */
    void delType(String type);

    List<Dictionary> listByIds(List<Long> ids);

    List<Dictionary> listByIds2(List<Long> ids,DictionaryPageQuery dictionaryPageQuery);

    List<Dictionary> listByObject(DictionaryPageQuery dictionaryPageQuery);


    /**
     * 条件查询
     * @param dictionary 组织角色实体
     * @param dictionary 组织id集合
     * @return
     */
    List<Dictionary> list(Dictionary dictionary,List<Long> ids);
    /**
     * 条件查询
     * @param dictionary 组织角色实体
     * @param dictionary 组织id集合
     * @return
     */
    List<Dictionary> list2(Dictionary dictionary,List<Long> ids);

    /**
     * 条件查询
     * @param dictionary 组织角色实体
     * @param dictionary 组织id集合
     * @return
     */
    List<Dictionary> list3(Dictionary dictionary,List<Long> ids);
    /**
     * 条件查询 緩存
     * @param dictionary 组织角色实体
     * @param ids 组织id集合
     * @return
     */
    List<Dictionary> listOfCache(Dictionary dictionary,List<Long> ids);

    R<IPage<Dictionary>> pageVo(PageParams<Dictionary> params);

}
